package com.iyjhsoc.game.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.iyjhsoc.game.domain.VO.CompetitionSmallGameVO;
import com.iyjhsoc.game.domain.VO.CompetitionVO;
import com.iyjhsoc.game.domain.entity.CompetitionDO;
import com.iyjhsoc.game.domain.entity.CompetitionSmallGameDO;
import com.iyjhsoc.game.domain.response.Response;
import com.iyjhsoc.game.service.CompetitionSmallGameService;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("iyj/competition/small")
public class CompetitionSmallController {
    @Resource
    CompetitionSmallGameService gameService;
    @PostMapping("queryList")
    public Response queryList(@RequestBody CompetitionSmallGameVO vo){
        Response response = gameService.queryList(vo);
        return response;
    }

    @PostMapping("queryCompetitionGame")
    public Response queryCompetitionGame(@RequestBody CompetitionSmallGameVO vo){
        Response response = gameService.queryCompetitionGame(vo);
        return response;
    }

    @PostMapping("saveCompetitionSmall")
    public Response saveCompetitionSmallGame(@RequestBody CompetitionSmallGameVO vo) {
        Response response = gameService.saveCompetitionSmall(vo);
        return response;
    }
    @PostMapping("updateCompetitionSmall")
    public Response updateCompetitionSmall(@RequestBody CompetitionSmallGameVO vo){
        Response response = gameService.updateCompetitionSmall(vo);
        return response;
    }

    @GetMapping("getCompetitionSmallGameById")
    public Response getCompetitionSmallGameById(String id){
        CompetitionSmallGameDO byId = gameService.getById(id);
        return Response.SUCCESS(byId);
    }

    @GetMapping("getOneKillRare")
    public Response getOneKillRare(String name1,String name2){
        Response oneKillRare = gameService.getOneKillRare(name1, name2);
        return oneKillRare;
    }
    @GetMapping("selectGameValue")
    @ApiOperation("获取比赛的击杀和时间")
    public Response selectGameValue(CompetitionSmallGameVO vo){
        Response response = gameService.selectGameValue(vo);
        return response;
    }
    @GetMapping("selectGameInfo")
    @ApiModelProperty("查询击杀和时间对局信息")
    public Response selectGameInfo(CompetitionSmallGameVO vo){
        return gameService.selectGameInfo(vo);
    }

    @GetMapping("queryGameBPInfo")
    @ApiModelProperty("获取对局BP信息")
    public Response queryGameBPInfo(CompetitionSmallGameVO vo){
        return gameService.queryGameBPInfo(vo);
    }
}
